import { getDaliyUnInsuranceCompanyList } from '@/api/insurance/company'
import type { InsuranceCompanyBalanceSaleDto } from '@/api/insurance/company/types'
import { getExpireCompanyList } from '@/api/pay'
import type { PageDto, PagesDto } from '@/api/types'
import type { FilterDto } from '@/render/FilterRender'
import TableRender, { type TableRenderColumnTypes } from '@/render/TableRender'
import router from '@/router'
import type { AnyObject } from '@/types'
import toNative from '@/utils/toNative'
import { Component } from 'vue-facing-decorator'
import Render from '@/render/Render'
import type { VxeColumnSlotTypes, VxeGridProps, VxeGridPropTypes, VxeTableDataRow } from 'vxe-table'

@Component
export class SaasExpireTip extends TableRender {
    filterConfig(): FilterDto {
        return {
            searchText: {
                name: '客户或商务名称',
                element: 'input',
            }
        }
    }

    onDetail(row: InsuranceCompanyBalanceSaleDto) {
        // router.push('/customer/' + row.companyId)
    }

    onLoadData(pageNum: number, pageSize: number, filters: AnyObject){
        return getExpireCompanyList({
            searchText: filters.searchText,
            pageNum,
            pageSize,
        })
    }

    tableColumnConfigOld = () => [
        {
            field: 'companyName',
            title: '客户名称',
        },
        {
            field: 'businessPrincipal',
            title: '商务负责人',
        },
        {
            field: 'deptName',
            title: '所属分组',
        },
        {
            field: 'rechargeAmount',
            title: '购买期限',

        },
        {
            field: 'accountExpireTime',
            title: '到期时间',
        },
        {
            field: 'expireTime',
            title: '离到期时间',
        },
        {
            field: 'operate',
            title: '操作',
            fixed: 'right',
            params: {
                buttons: [
                    {
                        text: '查看',
                        type: 'text',
                        click: this.onDetail.bind(this)
                    }
                ]
            },
            slots: {
                default: 'buttons'
            }
        }
    ] as TableRenderColumnTypes<InsuranceCompanyBalanceSaleDto>



}

export default toNative(SaasExpireTip)
